package alexattar.gdxtest.services;

import java.util.ArrayList;
import java.util.List;

import alexattar.gdxtest.Level;

public class LevelManager {
	private final List<Level> levels;
	
	public LevelManager() {
		Level level2 = new Level(2);
		level2.setName("Episode 3");
		
		Level level1 = new Level(1);
		level1.setName("Episode 2");
		level1.setNextLevel(level2);
		
		Level level0 = new Level(0);
		level0.setName("Episode 1");
		level0.setNextLevel(level1);
		
		levels = new ArrayList<Level>();
		levels.add(level0);
		levels.add(level1);
		levels.add(level2);
	}
	
	public List<Level> getLevels() {
		return levels;
	}
	
	public Level findLevelById(int id) {
		if (id < 0 || id >= levels.size()) {
			return null;
		}
		return levels.get(id);
	}
	
}
